<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>流程操作日志</title>
    <#include "/pubHeadStyle.html">
</head>
<body>

<table class="table-detail">
    <tr>
        <th style="width: 20%">流程运行ID:</th>
        <td name="runId"></td>
    </tr>
    <tr>
        <th>流程标题:</th>
        <td name="processSubject"></td>
    </tr>
    <tr>
        <th>用户名称:</th>
        <td name="userName"></td>
    </tr>
    <tr>
        <th>操作时间:</th>
        <td name="createTime"></td>
    </tr>
    <tr>
        <th>操作类型:</th>
        <td name="operatorType"></td>
    </tr>
    <tr>
        <th>备注:</th>
        <td >
            <div name="memo" style="width:630px; height: 90px; overflow-y: auto;"></div>
        </td>
    </tr>
</table>


<script>
    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index','table', 'setter', 'element', 'util'], function () {
        var setter = layui.setter
            , element = layui.element
            , $ = layui.$
            , util = layui.util;
        var id = '${id}';

        function getValue(data) {
            return data == null ? "" : data;
        }

        $.ajax({
            url: serverPath.workflowPath + setter.workflowLinkPath + 'bpmRunLog/get?id=' + id,
            type: "get",
            contentType: 'application/json',
            dataType: 'json',
            success: function (data) {
                var returnData = data.data;
                $("[name='runId']").html("<label>" + getValue(returnData.runId) + "</label>");
                $("[name='processSubject']").html("<label>" + getValue(returnData.processSubject) + "</label>");
                $("[name='userName']").html("<label>" + getValue(returnData.userName) + "</label>");
                var createTime = util.toDateString(returnData.createTime, "yyyy-MM-dd HH:mm:ss");
                $("[name='createTime']").html("<label>" + createTime + "</label>");
                var operatorType = "";
                switch (returnData.operatorType) {
                    case 0:
                        operatorType = "启动流程";
                        break;
                    case 1:
                        operatorType = "交办";
                        break;
                    case 2:
                        operatorType = "撤销";
                        break;
                    case 3:
                        operatorType = "删除流程实例";
                        break;
                    case 4:
                        operatorType = "同意(投票)";
                        break;
                    case 5:
                        operatorType = "反对(投票)";
                        break;
                    case 6:
                        operatorType = "弃权(投票)";
                        break;
                    case 7:
                        operatorType = "补签";
                        break;
                    case 8:
                        operatorType = "驳回";
                        break;
                    case 9:
                        operatorType = "驳回到发起人";
                        break;
                    case 10:
                        operatorType = "删除任务";
                        break;
                    case 11:
                        operatorType = "代理任务";
                        break;
                    case 13:
                        operatorType = "锁定任务";
                        break;
                    case 14:
                        operatorType = "任务解锁";
                        break;
                    case 15:
                        operatorType = "添加意见";
                        break;
                    case 16:
                        operatorType = "任务指派";
                        break;
                    case 17:
                        operatorType = "设定所有人";
                        break;
                    case 18:
                        operatorType = "结束任务";
                        break;
                    case 20:
                        operatorType = "收回任务";
                        break;
                    case 22:
                        operatorType = "保存流程草稿";
                        break;
                    case 23:
                        operatorType = "删除流程草稿";
                        break;
                    case 24:
                        operatorType = "办结转发";
                        break;
                    case 25:
                        operatorType = "追回";
                        break;
                    case 26:
                        operatorType = "任务交接";
                        break;
                }
                $("[name='operatorType']").html("<label>" + getValue(operatorType) + "</label>");
                $("[name='memo']").html("<label>" + getValue(returnData.memo) + "</label>");

            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.alert("暂无数据，请稍后操作！" + XMLHttpRequest.status);
            }
        });

    });
</script>

</body>
</html>